{extend name="common/form" /}
{block name="form" /}
<style rel="stylesheet" type="text/css">
    .pagination{float: right;}
    .pagination li{float: left;margin-right: 10px;cursor: pointer}
    .pagination .active{background-color: #0e90d2;color: white;padding: 2px;}
    .widget-body{padding-left: 0;}
    .am-u-sm-12 .am-cf{overflow-x:scroll}
    .am-u-sm-12 .am-cf::-webkit-scrollbar { width: 0 !important }
    .am-u-sm-12 .am-cf { -ms-overflow-style: none; }
    .am-u-sm-12 .am-cf { overflow: -moz-scrollbars-none; }
    .theme-white .tpl-header-logo{color: #000}
    .theme-black .tpl-header-logo{color: #a29a9a}
    .left-sidebar{height: 100vh;}

    .theme-black .layui-layer-content{background: #4b5357;color: #FFFFFF}
    .theme-black .layui-layer-btn{background:#d0d0d0;}
    .theme-black .layui-layer-title{background:#d0d0d0;}
    @media screen and (max-width: 1024px) {
        .left-sidebar {
            left: -240px;
        }
    }
    @media screen and (min-width: 1024px) {
        .left-sidebar {
            left: 0px;
        }
    }
</style>
<div class="widget-body am-fr">
</div>

<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">订单明细
                <br/>
                总支付额:{$total_money}元
                <br/>
                总送出积分:{$total_integral}分
                <br/>
                总重量:{$total_number}公斤
                <br/>
            </div>
            <div class="widget-function am-fr">
                <a href="javascript:;" class="am-icon-cog"></a>

            </div>
        </div>
        <form action="{:url()}">
            <input type="hidden"value="{$user_id}" name="user_id" />
            <input type="text" style="width: 300px" value="{$Request.get.searchWords}" name="searchWords" placeholder="订单号|下单人|电话号码|搜索"/>
            <select name="order_status" data-am-selected="{searchBox: 2}">
                <option value="5" {eq name="info.order_status" value="5"}selected{/eq}>全部</option>
                <option value="1" {eq name="info.order_status" value="1"}selected{/eq}>已接单</option>
                <option value="2" {eq name="info.order_status" value="2"}selected{/eq}>已完成</option>
            </select>

            <select name="time_type" data-am-selected="{searchBox: 2}" onchange="setS(this)" n id="selects">
                <option value="1" >全部时间</option>
                <option value="2"  {if ($start_time && $end_time)} selected{/if}>自选时间</option>
            </select>
            <span id="shows" {if ($start_time && $end_time)}  {else} style="display: none"{/if}>
                开始时间<input type="text" value="{$start_time|default=''}" autocomplete="off" name="start_time" data-am-datepicker />
                结束时间<input type="text" value="{$end_time|default=''}" autocomplete="off"  name="end_time" data-am-datepicker />
            </span>
            <button type="submit" class="am-btn am-btn-xs am-btn-default am-btn-success"><span class="am-icon-search"></span> 确定</button>
        </form>
        <div class="widget-body  widget-body-lg am-fr">

            <table width="100%" class="am-table am-table-compact am-table-bordered tpl-table-black ">
                <thead>

                <tr>
                    <th class="am-lg-text-center">
                        订单号</th>
                    <th class="am-lg-text-center">
                        回收员</th>
                    <th class="am-lg-text-center">
                        头像</th>
                    <th class="am-lg-text-center">
                        所属片区</th>

                    <th class="am-lg-text-center">
                        回收类型</th>
                    <th class="am-lg-text-center">
                        下单人</th>
                    <th class="am-lg-text-center">
                        住宅类型</th>
                    <th class="am-lg-text-center">
                        下单人电话</th>
                    <th class="am-lg-text-center">
                        预估重量</th>
                    <th class="am-lg-text-center">
                        预约时间</th>
                    <th class="am-lg-text-center">
                        下单时间</th>
                    <th class="am-lg-text-center">
                        订单状态</th>
                    <th class="am-lg-text-center">
                        结算金额</th>
                    <th class="am-lg-text-center">
                        结算积分</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                {foreach $list as $v}

                <tr class="gradeX">
                    <td class='am-lg-text-center'>                                {$v.order_number}</td>
                    <td class='am-lg-text-center'>                                {$v.accept_user_name}</td>
                    <td class='am-lg-text-center'>                                <img src="{$v.headimgurl}" style="width:50px;height:50px;"></td>

                    <td class='am-lg-text-center'>                                {$v.region_name}</td>

                    <td class='am-lg-text-center'>                                {$v.type_name}</td>

                    <td class='am-lg-text-center'>                                {$v.true_name}</td>
                    <td class='am-lg-text-center'>
                        {$v.address_type =="1"?"住宅 ":""}{$v.address_type =="2"?"商铺":""}{$v.address_type =="3"?"写字楼":""}{$v.address_type =="4"?"工厂":""}
                    </td>
                    <td class='am-lg-text-center'>                                {$v.phone}</td>

                    <td class='am-lg-text-center'>          {$v.weight_type ==1?"20-50公斤":""}
                        {$v.weight_type ==2?"50-100公斤":""}
                        {$v.weight_type ==3?"100公斤以上":""}
                    </td>

                    <td class='am-lg-text-center'>                                {$v.appointment_date} {$v.appointment_time}</td>
                    <td class='am-lg-text-center'>                                {$v.create_time}</td>

                    <td class='am-lg-text-center' style="color: red;">
                        {$v.order_status ==0?"未接单":""}{$v.order_status ==1?"已接单":""}{$v.order_status ==2?"已完成":""}{$v.order_status ==6?"已取消":""}
                    </td>
                    <td class='am-lg-text-center'>                                {$v.total_money}</td>
                    <td class='am-lg-text-center'>                                {$v.total_integral}</td>
                    <td>

                        <div class="tpl-table-black-operation">
                            <a onclick="openUrl('{:url('order/info',['id'=>$v['id']])}')">
                                <i class="am-icon-eye"></i> 详情信息
                            </a>
                            <!--   <a href="javascript:;" class="tpl-table-black-operation-del">
                                   <i class="am-icon-trash"></i> 删除
                               </a>-->
                        </div>

                    </td>

                </tr>

                {/foreach}



                </tbody>
            </table>

            {$list|raw}
            
        </div>
    </div>
</div>

    {/block}

{block name="script"}
<script type="text/javascript">
    function openUrl(url,title) {
        title = title||"编辑"
        var index = layer.open({
            type: 2,
            title:title,
            content: [url, 'yes'],
            area: ['60%','80%'],
            maxmin: true
        });
    }

    function setS(dom) {
        console.log('12321')
        if( dom.value ==2){
            $('#shows').show();
        }else{
            $('#shows').hide();
            $('input[name="start_time"]').val('');
            $('input[name="end_time"]').val('');
        }
    }


</script>
{/block}
    {/extend}
